<template>
  <div id="app">
    <el-menu :default-active="$route.path" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="/">首页</el-menu-item>
      <el-menu-item index="/manage">用户管理</el-menu-item>
      <el-menu-item index="/supplier-project">供应商维护</el-menu-item>
    </el-menu>
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {
  },
  methods: {
    handleSelect(key) {
      this.$router.push(key);
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

.el-menu-demo {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 为主内容区域添加顶部边距，避免被固定导航遮挡 */
.el-main, 
.supplier-project-list,
.project-supplier-detail {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

/* 全局样式优化 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

/* Element Plus 组件样式优化 */
.el-card {
  margin-bottom: 20px;
}

.el-table {
  font-size: 14px;
}

.el-button + .el-button {
  margin-left: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .el-form--inline .el-form-item {
    display: block;
    margin-right: 0;
  }
  
  .el-form--inline .el-form-item__content {
    margin-left: 0 !important;
  }
}
</style>